<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.2</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="/css/font.css">
    <link rel="stylesheet" href="/css/xadmin.css">
    <script src="/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
<div class="x-nav">
          <span class="layui-breadcrumb">
            <a href="">首页</a>
            <a href="">演示</a>
            <a>
              <cite>导航元素</cite></a>
          </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" id="shuaxin" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body ">
                    <form class="layui-form layui-col-space5" action="/admin-userGuanli-get">
                        <div class="layui-inline layui-show-xs-block">
                            <input type="text" name="email"  placeholder="请输入邮件" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                        </div>
                    </form>
                </div>
                <div class="layui-card-header">
                    <button class="layui-btn layui-btn-danger" ><i class="layui-icon"></i>批量删除</button>
                    <button class="layui-btn" onclick="xadmin.open('添加用户','/register',880,680)">
                        <i class="layui-icon"></i>添加</button></div>
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>
                                <input type="checkbox" lay-filter="checkall" name="" lay-skin="primary">
                            </th>
                            <th>uID</th>
                            <th>username</th>
                            <th>password</th>
                            <th>email</th>
                            <th>状态</th>
                            <th>操作</th></tr>
                        </thead>
                        <tbody>
                        <!--/*@thymesVar id="uid" type="java.lang.String"*/-->
                        <!--/*@thymesVar id="user" type="com.example.hotel_demo.pojo.User"*/-->
                        <!--/*@thymesVar id="userList" type="java.util.List"*/-->
                        <tr th:each="user : ${userList}">
                            <td>
                                <input type="checkbox" name="" lay-skin="primary"></td>
                            <td  id="uid"  th:text="${user.uID}"></td>
                            <td  th:text="${user.username}"></td>
                            <td  th:text="${user.password}"></td>
                            <td  th:text="${user.email}"></td>
                            <td class="td-status" th:if="${user.userState} == 0">
                                <span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span></td>
                            <td class="td-status" th:if="${user.userState} == 1">
                                <span class=" layui-btn layui-btn-normal layui-btn-mini layui-btn-disabled">已停用</span></td>

                            <td class="td-manage" >
                                <a  title="启用" th:if="${user.userState} == 1" th:href="@{/admin-userGuanli-qiyong-tj(uID=${user.uID})}">
                                    <i class="layui-icon">&#xe601;</i>
                                </a>
                                <a  title="停用" th:if="${user.userState} == 0" th:href="@{/admin-userGuanli-tingyong-tj(uID=${user.uID})}">
                                    <i class="layui-icon">&#xe601;</i>
                                </a>
                                <a title="管理登记"  th:href="@{/admin-userGuanli-cust-tj(uID=${user.uID})}">
                                    <i class="layui-icon">&#xe642;</i>
                                </a>
                                <a  title="修改密码" th:href="@{/admin-userGuanli-update-tj(uID=${user.uID})}">
                                    <i class="layui-icon">&#xe631;</i>
                                </a>
                                <a title="删除"  th:href="@{/admin-userGuanli-delete-tj(uID=${user.uID})}">
                                    <i class="layui-icon">&#xe640;</i></a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>
                            <!--/*@thymesVar id="pageUsers" type="com.example.hotel_demo.pojo.Page"*/-->

                            <a class="prev"  th:href="@{/admin-userGuanli(currentPage=${pageUsers.prevPage})}" >上一页</a>
                            <tr th:each="pageNums : ${pageUsers.showPageNums}" >
                                <td th:if="${pageNums} != ${pageUsers.currentPage} " >
                                    <a class="num" th:href="@{/admin-userGuanli(currentPage=${pageNums})}" th:text="${pageNums}"></a>
                                </td>
                                <td th:if="${pageNums} == ${pageUsers.currentPage} ">
                                    <span class="current" th:text="${pageUsers.currentPage}"></span>
                                </td>
                            </tr>
                            <a class="next"  th:href="@{/admin-userGuanli(currentPage=${pageUsers.nextPage})}" >下一页</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script type='text/javascript'>
    var shuaxin = document.getElementById("shuaxin");
    shuaxin.onclick = function (ev) {
        window.location = '/admin-userGuanli?currentPage=1';
    }
</script>
<script>
    layui.use(['laydate','form'], function(){
        var laydate = layui.laydate;
        var  form = layui.form;


        // 监听全选
        form.on('checkbox(checkall)', function(data){

            if(data.elem.checked){
                $('tbody input').prop('checked',true);
            }else{
                $('tbody input').prop('checked',false);
            }
            form.render('checkbox');
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });


    });

</script>
</html>